var t = require("../../../@babel/runtime/helpers/interopRequireDefault"), n = t(require("../DPagination")), e = t(require("../DHttp")), i = new n.default("historyList");

Page({
    data: {
        historyList: {},
        historyDataCount: 0
    },
    onLoad: function(t) {
        i.bind(this), i.clean(), this.getHistory();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.getHistory();
    },
    onShareAppMessage: function() {},
    getHistory: function() {
        var t = this;
        i.loading || i.finished || (i.loading = !0, wx.showLoading({
            title: "加载中",
            mask: !0
        }), e.default.request("plugin.credit-inventory.frontend.controllers.activate.index", {
            page: i.loadPage
        }).then(function(n) {
            var e = n.per_page, o = n.data, a = n.last_page, r = n.current_page;
            i.loading = !1, wx.hideLoading(), (o.length < e || a == r) && (i.finished = !0), 
            i.push(o), t.setData({
                historyDataCount: o.length + t.data.historyDataCount
            });
        }).catch(function(t) {
            var n = t.msg;
            i.loading = !1, wx.hideLoading(), wx.showToast({
                title: n,
                icon: "none"
            });
        }));
    }
});